﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Bussiness;

public partial class EditThemalTemplate : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            BindExprimentName();
    }
    protected void grvFeeInfo_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {

    }
    protected void ddlCompute_SelectedIndexChanged(object sender, EventArgs e)
    {
        BindExprimentName();
    }
    private void BindExprimentName()
    {
        Bussiness.ThermalTestTemplate template = new Bussiness.ThermalTestTemplate();
        template.UnitID = this.ddlCompute.SelectedValue;
        DataTable dt = template.GetReportName();
        this.ddlExperiment.DataSource = dt;
        this.ddlExperiment.DataTextField = "TemplateName";
        //this.ddlExperiment.DataValueField = "TemplateID";        
        this.ddlExperiment.DataBind();
        this.ddlExperiment.Items.Insert(0, new ListItem("全部", "0"));
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        Bussiness.ThermalTestReport report = new Bussiness.ThermalTestReport();
        DataTable dt = report.GetFinishExpriment(this.calStartTime.Text, this.calEndTime.Text, Convert.ToInt32(this.ddlExperiment.SelectedValue));
        this.grvFeeInfo.DataSource = dt;
        this.grvFeeInfo.DataBind();
    }
}
